extends ../main

block append body
    div#prodAdd.form-element
        div.col-lg-12(style="margin-top:40px")
            div.panel.form-element-padding.panel-info
                div.panel-heading
                    h3#header.panel-title 商品添加
                div.panel-body
                    div.col-lg-12(style="padding-top:20px;")
                        form.form-horizontal
                            div.form-group
                                label.col-sm-1.control-label.text-center(for="prodType") 商品类型
                                div.col-sm-2
                                    select#prodType.form-control
                                        option(value=1) 进口食品
                                        option(value=2) 日化用品
                                        option(value=3) 母婴专用
                                        option(value=4) 健康养生
                                label.col-sm-1.control-label.text-center(for="prodName") 商品名称
                                div.col-sm-2
                                    input#prodName.form-control(type="text",placeholder="商品名称")
                                    input#prodId(type="hidden")
                                label.col-sm-1.control-label.text-center(for="prodDesc") 商品描述
                                div.col-sm-2
                                    input#prodDesc.form-control(type="text",placeholder="商品描述")
                            div.form-group
                                label.col-sm-1.control-label.text-center(for="prodPrice") 商品价格
                                div.col-sm-2
                                    input#prodPrice.form-control(type="number",placeholder="商品价格")
                                label.col-sm-1.control-label.text-center(for="prodDiscountPrice") 会员价格
                                div.col-sm-2
                                    input#prodDiscountPrice.form-control(type="number",placeholder="会员价格")
                                label.col-sm-1.control-label.text-center(for="prodMinPrice") 商品进价
                                div.col-sm-2
                                    input#prodMinPrice.form-control(type="number",placeholder="商品进价")
                            div.form-group
                                label.col-sm-1.control-label.text-center(for="prodSendFee") 商品运费
                                div.col-sm-2
                                    input#prodSendFee.form-control(type="number",placeholder="商品运费")
                                label.col-sm-1.control-label.text-center(for="prodspec") 商品规格
                                div.col-sm-2
                                    input#prodspec.form-control(type="number",placeholder="商品规格")
                                label.col-sm-1.control-label.text-center(for="prodSton") 商品库存
                                div.col-sm-2
                                    input#prodSton.form-control(type="number",placeholder="商品库存")
                            div.form-group
                                label.col-sm-1.control-label.text-center(for="prodPics") 商品图片
                                div.col-sm-8
                                    input#prodPics(name="prodPics",type="file")
                            div.form-group
                                label.col-sm-1.control-label.text-center(for="prodContent") 商品详情
                                div.col-sm-8
                                    textarea#prodContent.summernote(name="prodContent",title="prodContent")
                    div.form-group.col-sm-offset-4
                        div.col-sm-1
                            input.btn.btn-info(type="button",value="返回")
                        div.col-sm-1
                            input#submit.btn.btn-primary(type="button",value="提交更改")
block append footer
    script(type="text/javascript").
        $(function() {
            var app = new Vue({
                el: "#prodAdd",
                data: {
                    prodPic: []
                },
                methods: {
                    init: function () {
                        zxlib.upload("prodPics", 4, function (event, data) {
                            if (data.code == "0") {
                                app.prodPic.push(data.imageUrl);
                            }
                        }, function (err) {
                            alert(err);
                        });

                        zxlib.richText("prodContent", "请输入内容", function (result) {

                        }, function (result) {

                        });
                    }
                }
            });
            app.init();
        });